Skip to content

Conversation

@jangel97
Copy link
Contributor

@jangel97 jangel97 commented Jan 19, 2026

Add GitLab Runner support to mapt, enabling automatic runner registration
on provisioned hosts. Implementation follows the existing GitHub Actions
integration pattern.

Features:

  • Cross-platform support (Linux, macOS, Windows)
  • Works on all mapt providers (AWS, Azure)
  • Simple CLI: --glrunner-token and --glrunner-url flags
  • Shell executor (only supported executor for now)

Implementation:

  • Created pkg/integrations/gitlab/ with platform-specific snippets
  • Added GitLab flags to CLI params
  • Integrated into cloud-config for RHEL, Fedora, Windows
  • Updated context manager to initialize GitLab integration
  • Modified all host commands to support GitLab runner flags

Technical details:

  • Downloads runner from GitLab's official S3 bucket
  • Non-interactive registration with authentication token
  • Installs as systemd service (Linux) / LaunchDaemon (macOS) / Windows service
  • Runner name auto-generated from mapt run ID
  • Tags, executor type, and scope managed in GitLab UI (not via CLI)

Example how to use:

 ./out/mapt aws fedora create \
    --glrunner-token ${GITLAB_TOKEN} \
    --glrunner-url "https://gitlab.com" \
    --project-name "gitlab-runner-test" \
    --backed-url file:///$PWD/state \
    --conn-details-output $PWD/outputs \
    --cpus 2 \
    --memory 4

Fixes #500

)

// Download URL
const runnerBaseURL = "https://gitlab-runner-downloads.s3.amazonaws.com/latest/binaries/gitlab-runner-%s-%s"
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Here I would prefer fixed version...you can pick it from a var and move it through the Makefile so we can update when new version is released.

Cause using latest we can no be sure which version we are shipping

@jangel97 jangel97 marked this pull request as draft January 19, 2026 17:40
  Migrate GitLab Runner integration from registration token workflow
  to authentication token workflow using Pulumi's GitLab provider.
  This aligns with GitLab 16.0+ recommended practices and enables
  programmatic runner creation.

  Changes:
  - --glrunner-token now expects GitLab PAT (api/create_runner scope)
  - New flags: --glrunner-project-id and --glrunner-group-id
  - Removed flags: --glrunner-executor, --glrunner-tags, --glrunner-scope

  Features:
  - Support for both project runners and group runners
  - Automatic runner creation via Pulumi during stack deployment
  - Runner configuration managed as code (tags, executor, access level)
  - Auto-detection of runner type based on ID provided

  Implementation:
  - Created pkg/integrations/gitlab/pulumi.go for Pulumi GitLab provider
  - Updated GitLabRunnerArgs with GitLabPAT, ProjectID, GroupID, AuthToken
  - Added SetAuthToken() for dynamic token injection during deployment
  - Implemented UserdataWithGitLabToken() for async token handling
  - Updated AWS Fedora provider to create runner before userdata generation
  - Modified CLI params to support new flag structure

  Usage:
  ./mapt aws fedora create \
    --glrunner-token <gitlab-pat> \
    --glrunner-group-id 12345 \
    --glrunner-url https://gitlab.com

Signed-off-by: Jose Angel Morena <[email protected]>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[Integration] Include gitlab as another integration

2 participants